home *** CD-ROM | disk | FTP | other *** search
-
- {*******************************************************}
- { }
- { Delphi Runtime Library }
- { }
- { Copyright (C) 1997 Borland International }
- { }
- {*******************************************************}
-
- unit ComServ;
-
- {$DENYPACKAGEUNIT}
-
- interface
-
- uses Windows, ActiveX, SysUtils, ComObj;
-
- type
-
- { Application start mode }
-
- TStartMode = (smStandalone, smAutomation, smRegServer, smUnregServer);
-
- { Class manager event types }
-
- TLastReleaseEvent = procedure(var Shutdown: Boolean) of object;
-
- { TComServer }
-
- TComServer = class(TComServerObject)
- protected
- function CountObject(Created: Boolean): Integer; override;
- function CountFactory(Created: Boolean): Integer; override;
- function GetHelpFileName: string; override;
- function GetServerFileName: string; override;
- function GetServerKey: string; override;
- function GetServerName: string; override;
- function GetTypeLib: ITypeLib; override;
- public
- constructor Create;
- destructor Destroy; override;
- procedure Initialize;
- procedure LoadTypeLib;
- procedure SetServerName(const Name: string);
- procedure UpdateRegistry(Register: Boolean);
- property IsInprocServer: Boolean;
- property ObjectCount: Integer;
- property StartMode: TStartMode;
- property OnLastRelease: TLastReleaseEvent;
- end;
-
- var
- ComServer: TComServer;
-
- function DllGetClassObject(const CLSID, IID: TGUID; var Obj): HResult; stdcall;
- function DllCanUnloadNow: HResult; stdcall;
- function DllRegisterServer: HResult; stdcall;
- function DllUnregisterServer: HResult; stdcall;
-
- implementation
-